package bm.com.project.server.project.controller;

import bm.com.framework.common.config.EnumRoute;
import bm.com.project.server.VerifyController;
import bm.com.project.server.common.dto.SearchBaseDTO;
import bm.com.project.server.project.dto.BmProjectMilestoneDTO;
import bm.com.project.server.project.service.BmProjectMilestoneService;
import bm.com.framework.common.resp.ResultVO;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;



/**
 * 项目里程碑
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2024-05-31 16:33:33
 */
@RestController
@RequestMapping(EnumRoute.ProjectRoute.BASE)
public class ProjectMilestoneController extends VerifyController {

    @Resource
    BmProjectMilestoneService bmProjectMilestoneService;

    /**
     * 添加信息
     * @param bmProjectMilestoneDTO
     * @return
     */
    @PostMapping(EnumRoute.ProjectRoute.Milestone.CREATE)
    public ResultVO create(@RequestBody BmProjectMilestoneDTO bmProjectMilestoneDTO) {
//        ValidatorUtils.validateEntity(bmProjectMilestoneDTO);
        return bmProjectMilestoneService.create(bmProjectMilestoneDTO);
    }

    /**
     * 获取数据列表
     * @param queue
     * @return
     */
    @PostMapping(EnumRoute.ProjectRoute.Milestone.GET_LIST)
    public ResultVO getList(@RequestBody SearchBaseDTO queue){
        return bmProjectMilestoneService.getList(queue);
    }
}
